import service from '@/utils/request'

const BASE_URL = 'api-system'

//获取活动列表
export function activityList(data) {
    return service({
        url: `${BASE_URL}/activities`,
        method: 'get',
        params: data
    })
}

// 新增活动
export function addActivity(data) {
    return service({
        url: `${BASE_URL}/activity`,
        method: 'post',
        data
    })
}

// 修改活动
export function updateActivity(data) {
    return service({
        url: `${BASE_URL}/activity`,
        method: 'put',
        data
    })
}

//获取活动
export function getActivity(activityId) {
    return service({
        url: `${BASE_URL}/activity/${activityId}`,
        method: 'get'
    })
}

//删除活动
export function deleteActivity(activityId) {
    return service({
        url: `${BASE_URL}/activity/${activityId}`,
        method: 'delete'
    })
}

//修改活动状态
export function updateActivityStatus(activityId,status) {
    return service({
        url: `${BASE_URL}/activity/${activityId}/status/${status}`,
        method: 'put'
    })
}
